const path = require("path");

module.exports = {
  // publicPath:
  //   process.env.NODE_ENV === "production" ? "/metronic/vue/demo2/" : "/",
  configureWebpack: {
    resolve: {
      alias: {
        // If using the runtime only build
        vue$: "vue/dist/vue.runtime.esm.js" // 'vue/dist/vue.runtime.common.js' for webpack 1
        // Or if using full build of Vue (runtime + compiler)
        // vue$: 'vue/dist/vue.esm.js'      // 'vue/dist/vue.common.js' for webpack 1
      }
    }
  },
  chainWebpack: config => {
    config.module
      .rule("eslint")
      .use("eslint-loader")
      .tap(options => {
        options.configFile = path.resolve(__dirname, ".eslintrc.js");
        return options;
      });
  },
  productionSourceMap: true,
  devServer: {
    proxy: {
      '/api': {
        target: 'https://macro.ink',
        // target:"http://localhost:8001",
        changeOrigin: true,
        pathRewrite: {
          '/api': ''
        },
      },
    }
  }
};
